home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / internet / amitcp3.0b / src.lha / src / amitcp / netinet / in_var.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  3.6 KB  |  95 lines

  1. /*
  2.  * $Id: in_var.h,v 1.2 1993/03/03 21:45:21 jraja Exp $
  3.  *
  4.  * HISTORY
  5.  * $Log: in_var.h,v $
  6.  * Revision 1.2  1993/03/03  21:45:21  jraja
  7.  * Moved some data definitions to in.c.
  8.  *
  9.  * Revision 1.1  92/11/17  16:29:20  16:29:20  jraja (Jarno Tapio Rajahalme)
  10.  * Initial revision
  11.  * 
  12.  *
  13.  */
  14.  
  15. /*
  16.  * Copyright (c) 1985, 1986 Regents of the University of California.
  17.  * All rights reserved.
  18.  *
  19.  * Redistribution and use in source and binary forms, with or without
  20.  * modification, are permitted provided that the following conditions
  21.  * are met:
  22.  * 1. Redistributions of source code must retain the above copyright
  23.  *    notice, this list of conditions and the following disclaimer.
  24.  * 2. Redistributions in binary form must reproduce the above copyright
  25.  *    notice, this list of conditions and the following disclaimer in the
  26.  *    documentation and/or other materials provided with the distribution.
  27.  * 3. All advertising materials mentioning features or use of this software
  28.  *    must display the following acknowledgement:
  29.  *    This product includes software developed by the University of
  30.  *    California, Berkeley and its contributors.
  31.  * 4. Neither the name of the University nor the names of its contributors
  32.  *    may be used to endorse or promote products derived from this software
  33.  *    without specific prior written permission.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  36.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  37.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  38.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  39.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  40.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  41.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  42.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  43.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  44.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  45.  * SUCH DAMAGE.
  46.  *
  47.  *    @(#)in_var.h    7.6 (Berkeley) 6/28/90
  48.  */
  49.  
  50. #ifndef IN_VAR_H
  51. #define IN_VAR_H
  52.  
  53. /*
  54.  * Interface address, Internet version.  One of these structures
  55.  * is allocated for each interface with an Internet address.
  56.  * The ifaddr structure contains the protocol-independent part
  57.  * of the structure and is assumed to be first.
  58.  */
  59. struct in_ifaddr {
  60.     struct    ifaddr ia_ifa;        /* protocol-independent info */
  61. #define    ia_ifp        ia_ifa.ifa_ifp
  62. #define ia_flags    ia_ifa.ifa_flags
  63.                     /* ia_{,sub}net{,mask} in host order */
  64.     u_long    ia_net;            /* network number of interface */
  65.     u_long    ia_netmask;        /* mask of net part */
  66.     u_long    ia_subnet;        /* subnet number, including net */
  67.     u_long    ia_subnetmask;        /* mask of subnet part */
  68.     struct    in_addr ia_netbroadcast; /* to recognize net broadcasts */
  69.     struct    in_ifaddr *ia_next;    /* next in list of internet addresses */
  70.     struct    sockaddr_in ia_addr;    /* reserve space for interface name */
  71.     struct    sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */
  72. #define    ia_broadaddr    ia_dstaddr
  73.     struct    sockaddr_in ia_sockmask; /* reserve space for general netmask */
  74. };
  75.  
  76. struct    in_aliasreq {
  77.     char    ifra_name[IFNAMSIZ];        /* if name, e.g. "en0" */
  78.     struct    sockaddr_in ifra_addr;
  79.     struct    sockaddr_in ifra_broadaddr;
  80. #define ifra_dstaddr ifra_broadaddr
  81.     struct    sockaddr_in ifra_mask;
  82. };
  83. /*
  84.  * Given a pointer to an in_ifaddr (ifaddr),
  85.  * return a pointer to the addr as a sockaddr_in.
  86.  */
  87. #define    IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr))
  88.  
  89. #ifdef    KERNEL
  90. extern struct    in_ifaddr *in_ifaddr;
  91. extern struct    ifqueue    ipintrq;        /* ip packet input queue */
  92. #endif
  93.  
  94. #endif /* !IN_VAR_H */
  95.